//
//  ZYCSettingNewsPushCell.m
//  ZDSC
//
//  Created by ZDTX on 2021/8/24.
//

#import "ZYCSettingNewsPushCell.h"
@interface ZYCSettingNewsPushCell ()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UISwitch *switchButton;

@end
@implementation ZYCSettingNewsPushCell

- (void)setTitleString:(NSString *)titleString{
    _titleString = titleString;
    _titleLabel.text = titleString;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.switchButton];
    
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(15.0f);
            make.centerY.equalTo(self.contentView);
        }];
        
        [self.switchButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.contentView).offset(-15.0f);
            make.centerY.equalTo(self.contentView);;
        }];
    }
    return self;
}


- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Regular", 16.0f) titleColor:HEX_RGB(@"#2D2D2D") textAlignment:ZZTextAlignmentLeft];
    }
    return _titleLabel;
}

- (UISwitch *)switchButton {
    if (!_switchButton) {
        _switchButton = [[UISwitch alloc] init];
    }
    return _switchButton;
}
@end
